package base.thread_JUC2.chapter02.demo05;

public class TestCase {

    public static void main(String[] args) {
        PricesInfo info = new PricesInfo();

        Writer writer = new Writer(info);
        Thread w = new Thread(writer, "线程写");

        // 启动读线程(5个)
        for (int i = 0; i < 5; i++) {
            Reader reader = new Reader(info);
            Thread r = new Thread(reader,"线程读 "+i);
            r.start();
        }

        // 启动写线程
        w.start();
    }

}
